package gew.table;

import java.sql.ResultSet;
import java.sql.SQLException;

public class TableDimensionValue {

    private final static int ID = 1;
    private final static int CODE = 2;
    private final static int NAME = 3;
    private final static int URL_CODE = 4;
    private final static int COLOR = 5;
    private final static int ORDER_BY = 6;
    private final static int SELECTED = 7;
    private final static int LEVEL = 8;
    
    private final int id;
    private final String code;
    private final String name;
    private final String urlCode;
    private final String color;
    private final int orderBy;
    private final byte selected;
    private final int level;
    private int colspan = 1;
    private int rowspan = 1;
    private TableDimension tableDimension;
    
    public TableDimensionValue(int id, String code, String name, String urlCode, String color, int orderBy, byte selected, int level) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.urlCode = urlCode;
        this.color = color;
        this.orderBy = orderBy;
        this.selected = selected;
        this.level = level;
    }
    
    public TableDimensionValue(ResultSet rs) throws SQLException {
        this(rs.getInt(ID), rs.getString(CODE), rs.getString(NAME), rs.getString(URL_CODE), rs.getString(COLOR), rs.getInt(ORDER_BY), rs.getByte(SELECTED), rs.getInt(LEVEL));
    }
    
    public Integer getId() {
        return id;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getName() {
        return name;
    }
    
    public String getUrlCode() {
        return urlCode;
    }
    
    public String getColor() {
        return color;
    }

    public Integer getOrderBy() {
        return orderBy;
    }

    public byte getSelected() {
        return selected;
    }

    public int getColspan() {
        return colspan;
    }

    public void setColspan(int colspan) {
        this.colspan = colspan;
    }

    public int getRowspan() {
        return rowspan;
    }

    public void setRowspan(int rowspan) {
        this.rowspan = rowspan;
    }

    public TableDimension getTableDimension() {
        return tableDimension;
    }

    public void setTableDimension(TableDimension tableDimension) {
        this.tableDimension = tableDimension;
    }

    public int getLevel() {
        return level;
    }
    
}
